<?php
class ModelSpecAction extends CommonAction{
	function index(){
		if($_GET['id']){
			$id=$this->_get("id");
			$Model=D("Model");
			$this->model_data=$Model->find($id);
			$M= new Model();
			$this->data=$M->query("select * from model_spec as msp inner join spec as sp on msp.spec_id=sp.id where msp.model_id=$id");
			$Spec=D("Spec");
			$this->base_spec=$Spec->get_base_spec();
			print_r($this->data);
			$this->display();
		}
		else 
		{
			$this->redirect(GROUP_NAME.'/Model/index');
		}
	}
}